import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: 12629
 * Date: 2021/11/1
 * Time: 11:10
 * Description:
 */
class Student implements Comparable<Student>{
    public String name;
    public String classes;
    public double score;

    public Student(String name, String classes, double score) {
        this.name = name;
        this.classes = classes;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", classes='" + classes + '\'' +
                ", score=" + score +
                '}';
    }

    @Override
    public int compareTo(Student o) {
        return this.name.compareTo(o.name);
    }
}
public class TestDemo3 {

    public static void func(String str1,String str2) {
        List<Character> list = new ArrayList<>();
        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if(!str2.contains(ch+"")) {
                list.add(ch);
            }
        }
        //System.out.println(list);
        for (Character character : list) {
            System.out.print(character);
        }
    }

    public static void main(String[] args) {
        func("welcome to bit","come");
    }

    public static void main3(String[] args) {
        List<Student> list = new ArrayList<>();//[1,3)
        list.add(new Student("bit","1",98.9));
        list.add(new Student("ait2","3",18.9));
        list.add(new Student("cit3","2",90.9));
        System.out.println(list);
        ///Collections.sort(list);
        Collections.reverse(list);
        System.out.println(list);
    }

    public static void main2(String[] args) {
        List<String> list2 = new ArrayList<>();//顺序表
        list2.add("bit1");
        list2.add("bit2");
        list2.add("bit3");
        list2.add("bit4");
        list2.add("bit5");
        System.out.println(list2);

        List<String> list = list2.subList(1,3);//[1,3)
        System.out.println(list);

        System.out.println("====================");
        list.set(0,"gb");
        System.out.println(list2);
        System.out.println(list);

    }
    public static void main1(String[] args) {
        List<String> list = new ArrayList<>();//顺序表
        list.add("hello");//放到数组的最后的
        list.add(1,"gb");
        System.out.println(list);
        System.out.println("=================");
        List<String> list2 = new ArrayList<>();//顺序表
        list2.add("bit1");
        list2.add("bit2");
        list2.add("bit3");
        list.addAll(list2);
        System.out.println(list);
        String str = list.remove(2);
        System.out.println(str);
        System.out.println(list);
        System.out.println("=================");
        System.out.println(list.indexOf("bit2"));
        System.out.println(list);

        list.clear();

/*
        List<Integer> list3 = new ArrayList<>();//顺序表
        //list.addAll(list3);

        List<String> listo = new ArrayList<>();//顺序表*/

    }
}
